#include <iostream>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;

int main() {
    priority_queue<int, vector<int>, greater<int>> q;
    long long sum = 0;
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        int num;
        cin >> num;
        q.push(num);
    }
    int ret = 0;
    while (sum < k)
    {
        int num = q.top();
        q.pop();
        sum += num;
        num *= 2;
        q.push(num);
        ret++;
    }
    cout << ret - 1 << endl;
    return 0;
}

int n;
string str;
int sum = 0;

bool YN(int i, int k)
{
    if (i == n)
    {
        return false;
    }
    int k1 = k + str[i] - '0';
    if (sum - k1 == k1)
    {
        return true;
    }
    if (sum - k1 < k1)
    {
        return false;
    }
    return YN(i + 1, k1) || YN(i + 1, k);
}

int main() {
    cin >> str;
    n = str.size();
    for (int i = 0; i < n; i++)
    {
        sum += str[i] - '0';
    }
    if (YN(0, 0))
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

int main() {
    int T;
    cin >> T;
    while (T--)
    {
        long long n, a, b;
        cin >> n >> a >> b;
        long long k = (n / 2 + n % 2 == 0 ? 0 : 1);
        long long ret = INT_MAX;
        for (long long i = 0; i <= k; i++)
        {
            long long sum = (i * a + ((n - i * 2) / 3 + (n - i * 2) % 3 == 0 ? 0 : 1) * b);
            ret = min(ret, sum);
        }
        cout << ret << endl;
    }
    return 0;
}

typedef long long LL;
LL n, a, b;

LL fun()
{
    if (n <= 2)
    {
        return min(a, b);
    }
    LL ret = 0;
    if (a * 3 < b * 2)
    {
        ret += n / 2 * a;
        n % 2;
        if (n)
        {
            ret += min(min(a, b), b - a);
        }
    }
    else
    {
        ret += n / 3 * b;
        n %= 3;
        if (n == 1)
        {
            ret += min(min(a, b), 2 * a - b);
        }
        if (n == 2)
        {
            ret += min(min(a, b), 3 * a - b);
        }
    }
    return ret;
}

int main() {
    int T;
    cin >> T;
    while (T--)
    {
        cin >> n >> a >> b;
        cout << fun() << endl;
    }
    return 0;
}


string str;
typedef long long ll;

ll nums()
{
    for (int i = str.size() - 2; i >= 0; i--)
    {
        str += str[i];
    }
    return stol(str);
}

ll nums()
{
    int n = str.size();
    string ret = str.substr(0, n - 1);
    reverse(ret.begin(), ret.end());
    str += ret;
    return stol(str);
}

bool bealn(ll n)
{
    if (n < 2)
    {
        return false;
    }
    for (ll i = 2; i <= sqrt(n); i++)
    {
        if (n % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main() {
    cin >> str;
    ll n = nums();
    if (bealn(n))
    {
        cout << "prime" << endl;
    }
    else
    {
        cout << "noprime" << endl;
    }
    return 0;
}